function X=cryoVolume2Rays(pf)
%
% Convert the 3D Fourier dataset (first dimension is x, second dimension
% y,third dimension slice number) into a 2D rays data set. 
% The dataset has one row for each Fourier ray, and n_theta x n_proj rows.
% The first n_theta rows correspond to slice 1, the next n_theta to slice 2
% and so on. 
%
% Yoel Shkolnisky, September 2007.

n_proj=1;
if ndims(pf)==3
    n_proj=size(pf,3);
end

n_r=size(pf,1);
n_theta=size(pf,2);

X=zeros(n_theta*n_proj,n_r);
for k=1:n_proj
    for j=1:n_theta
        X((k-1)*n_theta+j,:)=pf(:,j,k);
    end
end
